//app.js

App({
  onLaunch: function () {
      console.log('app', getApp());
    // 展示本地存储能力
    var user = wx.getStorageSync('user') || {};
    
    console.log(user);

    if (user.hasOwnProperty('id')) {
        wx.reLaunch({
            url: '/pages/home/index',
        });
    } else {
        wx.reLaunch({
            url: '/pages/login/index',
        })
    }
  },

  globalData: {
    userInfo: null
  }
})